package com.lvmama.pangolin.service.impl;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.jboss.logging.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lvmama.pangolin.common.Constant;
import com.lvmama.pangolin.common.DateUtil;
import com.lvmama.pangolin.entity.Task_History;
import com.lvmama.pangolin.mybatis.mapper.TaskHistoryMapper;
import com.lvmama.pangolin.service.TaskHistoryService;
@Transactional
@Service
public class TaskHistoryServiceImpl implements TaskHistoryService{
	/**  
	* @Title：TCTaskHistoryServiceImpl.java
	* @Author:zhoutianqi
	* @Description:
	* @Date：2017年2月20日下午6:13:38  
	*/
	private Logger logger = Logger.getLogger(getClass());
	@Autowired
	private TaskHistoryMapper taskHistoryMapper;
	@Override
	public int insertTask(Task_History task) throws Exception {
		if(task.getSyscode()==null || task.getSyscode().equals("")){
			logger.warn("TaskHistory入库失败， SysCode 不能为空！");
			return 0;
		}
		return taskHistoryMapper.insertTask(task);
	}

	@Override
	public List<Task_History> getAllTaskList(Map<String,Object> map) throws Exception {
		return taskHistoryMapper.getAllTaskList(map);
	}
	public List<Task_History> getTaskListByDays(Map<String,Object> map)throws Exception{
		return taskHistoryMapper.getTaskListByDays(map);
	}
	public List<Task_History> getTaskByID(Map<String,Object> map)throws Exception{
		return taskHistoryMapper.getTaskByID(map);
	}

	@Override
	public List<Task_History> getTaskListByDate() {
		return taskHistoryMapper.getTaskListByDate();
	}
}
